package com.tianji.learning.controller;


import com.tianji.common.domain.dto.PageDTO;
import com.tianji.learning.domain.query.ReplyPageQuery;
import com.tianji.learning.domain.vo.ReplyVO;
import com.tianji.learning.service.IInteractionReplyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 互动问题的回答或评论 前端控制器
 * </p>
 *
 * @author lyh
 * @since 2024-12-11
 */
@RestController
@RequestMapping("/admin/replies")
@Api(tags = "回答评论相关接口")
public class InteractionReplyAdminController {
    @Autowired
    private IInteractionReplyService replyService;
    @GetMapping("/page")
    @ApiOperation("分页查询回答或评论列表")
    public PageDTO<ReplyVO> pageQuery(ReplyPageQuery query){
      return replyService.pageQueryAdmin(query);
    }

    @PutMapping("/{id}/hidden/{hidden}")
    @ApiOperation("管理端隐藏或显示评论")
    public void hiddenReply(@PathVariable("id") Long id, @PathVariable("hidden") Boolean hidden){
        replyService.hiddenReply(id,hidden);
    }
}